package queue;

/**
 * A binary search tree that keeps values of type V (comparable) 
 * associated to keys of type K (comparable).
 */
public interface BSTree<K extends Comparable<K>, V extends Comparable<V>> {

	/**
	 * Returns the heigh of the tree. 
	 */
	public int height();

	/**
	 * Returns the value associated to the given key or null if it is not 
	 * in the tree. 
	 */
	public boolean search(K key);

	public void insert(K key, V value);


	/**
	 * Returns the maximum key of the tree or null if the tree is empty.
	 */
	public K maximumKey();

	/**
	 * Returns the minimum key of the tree or null if the tree is empty.
	 */
	public K minimumKey();
	

	/**
	 * Removes a node of a tree identified by a given key. 
	 */
	public void remove(K key);

	/**
	 * Returns how many elements were put into the tree. 
	 */
	public int size();
	
	/**
	 * Traverses the tree in pre-order and returns an array containing the values 
	 * in that order.
	 */
	public V[] preOrder();

}
